#ifndef DATA_MAP_H
#define DATA_MAP_H

#include <string>
#include "Common/Collections/Vector.h"

#include "Data/Objects/Obstacle.h"

namespace data {

	class Map {
	public:
		Map(
			std::string name,
			std::string description ) :
			m_name( name ),
			m_description( description )
		{
			m_obstacles = new cmn::Vector<Obstacle>();
		}

		Map( const Map& map ) :
			m_name( map.GetName() ),
			m_description( map.GetDescription() )
		{
			m_obstacles = new cmn::Vector<Obstacle> ( map.GetObstacles() );
		}

		~Map() {
			delete m_obstacles;
		}

		inline const std::string GetName() const { return m_name; }
		inline void SetName( std::string name ) { m_name = name; }

		inline const std::string GetDescription() const { return m_description; }
		inline void SetDescription( std::string description ) { m_description = description; }

		inline void AddObstacle( const Obstacle& obstacle ) { m_obstacles->Add( obstacle ); }
		inline void RemoveObstacle( const Obstacle& obstacle ) { m_obstacles->Remove( obstacle ); }
		inline const cmn::IIterable<Obstacle>* GetObstacles() const { return m_obstacles; }

	private:
		std::string m_name;
		std::string m_description;
		cmn::Vector<Obstacle>* m_obstacles;
	};

	inline bool operator == ( const Map& a, const Map& b ) {
		if( a.GetName() != b.GetName() ) return false;
		if( a.GetDescription() != b.GetDescription() ) return false;

		if( !IterablesAreEqual( a.GetObstacles(), b.GetObstacles() ) ) return false;
		return true;
	}

	inline bool operator != ( const Map& a, const Map& b ) {
		return !( a == b );
	}
}
#endif

